//
//  MovieRootViewController.m
//  FNer
//
//  Created by dllo on 15/11/7.
//  Copyright © 2015年 刘志强. All rights reserved.
//

#import "MovieRootViewController.h"
#import "MovieViewController.h"
#import "MyMovieViewController.h"
@interface MovieRootViewController ()
@property (nonatomic,retain)MovieViewController *movie;
@property (nonatomic,retain)MyMovieViewController *myMovie;

@end

@implementation MovieRootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  //  UISegmentedControl *sage = [[UISegmentedControl alloc]initWithItems:[NSArray arrayWithObjects:@"视频",@"我的视频", nil]];
 //   sage.selectedSegmentIndex = 0;
    
//    [sage initWithRect:140 andY:10 andWidth:80 andheight:20];
//    [sage addTarget:self action:@selector(sageAvtion:)   forControlEvents:(UIControlEventValueChanged)];
    self.navigationItem.title = @"我的视频";
    
    
    
    //将Root 作为两个页面的试图控制器
    
    self.movie = [[MovieViewController alloc]init];
 //   self.myMovie = [[MyMovieViewController alloc]init];
    
    [self addChildViewController:self.movie];
 //   [self addChildViewController:self.myMovie];
    
   
  //  [self.view addSubview:self.myMovie.view];
    [self.view addSubview:self.movie.view];

}
- (void)sageAvtion:(UISegmentedControl *)sage
{
    if (sage.selectedSegmentIndex == 0) {
        [self.view bringSubviewToFront:self.movie.view];
    }
    else
    {
             [self.view bringSubviewToFront:self.myMovie.view];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
